package jp.co.technotree.apl.dao.action;

import jp.co.technotree.common.dao.BaseDAO;
import jp.co.technotree.common.exception.DataAccessException;
import jp.co.technotree.common.exception.DataAccessObjectException;
import jp.co.technotree.common.util.DBGLog;

public class ActionUpdDAO extends BaseDAO{
	private static String CLASSNAME=ActionUpdDAO.class.getSimpleName();

	public long getNewId() throws DataAccessException{
		String METHODNAME = "getNewId";
		DBGLog.sqllog(CLASSNAME,METHODNAME,"START");
		long newId=0;
		
		try {
			newId = execueSequence("xcg_action_seq");
		} catch (Exception e) {
			e.printStackTrace();
			throw new DataAccessObjectException(""+e.getMessage());
		}
		
		DBGLog.sqllog(CLASSNAME,METHODNAME,"END");
		return newId;
	}
	
	public int insert(ActionBean actionBean) throws DataAccessException{
		String METHODNAME = "insert";
		DBGLog.sqllog(CLASSNAME,METHODNAME,"START");
		ActionBean list[] = new ActionBean[1];
		list[0] = actionBean;
		int result = insertSQL(list,"xcg_action_tbl");
		DBGLog.sqllog(CLASSNAME,METHODNAME,"END");
		return result;
	}
	
	public int insert(ActionBean actionBeanList[]) throws DataAccessException{
		String METHODNAME = "insert";
		DBGLog.sqllog(CLASSNAME,METHODNAME,"START");
		int result = insertSQL(actionBeanList,"xcg_action_tbl");
		DBGLog.sqllog(CLASSNAME,METHODNAME,"END");
		return result;
	}
}
